﻿using System;
using System.Collections.Generic;
using System.Text;
using Axis.BusinessObject.News;
using Axis.BusinessObject.Core;
using Axis.Dao.SQL;
using Axis.Dao.Base;
using FWS.Framework.Log;
using Axis.BusinessObject;
using Axis.BusinessObject.Axis.BusinessObject;
using Axis.BusinessObject.Product;

namespace Axis.Dao.Visitor
{
    public class CVisitorDao : CDaoBase
    {/// <summary>
        /// 
        /// </summary>
        /// <param name="pInputValue"> 
        /// <InputValue UserID="1" ID="1" />
        /// Neu lay theo danh sach thi ko co ID
        /// </param>
        /// <returns></returns>
        public CVisitorSetting GetVisitor(string pInputValue)
        {
            try
            {
                COutputValue output = new COutputValue();
                IList<CVisitorSetting> list = CallFunctionWithList<CVisitorSetting>(CSystemFunction.GetVisitor, pInputValue, ref output);
                LastOutputValue = output;

                return list[0];
            }
            catch (Exception ex)
            {
                CLogManager.WriteDAL("GetCustomer", ex.Message);
                return null;
            }
        }

        /// <summary>
        /// <InputValue UserID="" Session="" Action="INSERT|UPDATE|DELETE" Title="" Summary="" Content="" />
        /// </summary>
        /// <param name="pInputValue">
        /// </param>
        /// <returns></returns>
        public CApplicationMessage ActionVisitor(string pInputValue)
        {
            try
            {
                COutputValue output = new COutputValue();
                CApplicationMessage obj = CallFunction<CApplicationMessage>(CSystemFunction.ActionVisitor, pInputValue);
                return obj;
            }
            catch (Exception ex)
            {
                CLogManager.WriteDAL("GetCustomer", ex.Message);
                return null;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="pInputValue"> 
        /// <InputValue UserID="1" ID="1" />
        /// Neu lay theo danh sach thi ko co ID
        /// </param>
        /// <returns></returns>
        public CVisitorSetting GetVisitorSetting(string pInputValue)
        {
            try
            {
                COutputValue output = new COutputValue();
                IList<CVisitorSetting> list = CallFunctionWithList<CVisitorSetting>(CSystemFunction.GetVisitorSetting, pInputValue, ref output);
                LastOutputValue = output;

                return list[0];
            }
            catch (Exception ex)
            {
                CLogManager.WriteDAL("GetCustomer", ex.Message);
                return null;
            }
        }

        /// <summary>
        /// <InputValue UserID="" Session="" Action="INSERT|UPDATE|DELETE" Title="" Summary="" Content="" />
        /// </summary>
        /// <param name="pInputValue">
        /// </param>
        /// <returns></returns>
        public CApplicationMessage ActionVisitorSetting(string pInputValue)
        {
            try
            {
                COutputValue output = new COutputValue();
                CApplicationMessage obj = CallFunction<CApplicationMessage>(CSystemFunction.ActionVisitorSetting, pInputValue);
                return obj;
            }
            catch (Exception ex)
            {
                CLogManager.WriteDAL("GetCustomer", ex.Message);
                return null;
            }
        }

    }
}
